/*
 Navicat MySQL Data Transfer

 Source Server         : 本地测试
 Source Server Type    : MySQL
 Source Server Version : 50726
 Source Host           : localhost
 Source Database       : mdmp

 Target Server Type    : MySQL
 Target Server Version : 50726
 File Encoding         : utf-8

 Date: 11/04/2019 16:57:44 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `mdmp_grxx`
-- ----------------------------
DROP TABLE IF EXISTS `mdmp_grxx`;
CREATE TABLE `mdmp_grxx` (
  `idcard` varchar(50) NOT NULL COMMENT '证件编号 -主键',
  `name` varchar(200) NOT NULL COMMENT '姓名 ',
  `mz` int(11) DEFAULT NULL COMMENT '民族',
  `sex` int(11) DEFAULT NULL COMMENT '性别',
  `phone` varchar(50) DEFAULT NULL COMMENT '联系电话',
  `marry` int(11) DEFAULT NULL COMMENT '婚姻状况',
  `edu` int(11) DEFAULT NULL COMMENT '教育程度',
  `hkxz` int(11) DEFAULT NULL COMMENT '户口性质',
  `hkaddr` varchar(500) DEFAULT NULL COMMENT '户口地址',
  `address` varchar(500) DEFAULT NULL COMMENT '联系地址',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `del` tinyint(4) DEFAULT NULL COMMENT '删除标志',
  `del_time` datetime DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`idcard`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='患者个人基本信息';

-- ----------------------------
--  Table structure for `mdmp_gxy`
-- ----------------------------
DROP TABLE IF EXISTS `mdmp_gxy`;
CREATE TABLE `mdmp_gxy` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `idcard` varchar(50) NOT NULL COMMENT '患者证件号码',
  `ss` double DEFAULT NULL COMMENT '收缩压',
  `sz` double DEFAULT NULL COMMENT '收缩压',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `up_time` datetime NOT NULL COMMENT '上传时间',
  `measure_time` datetime NOT NULL COMMENT '测量时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `md` (`idcard`,`measure_time`) USING BTREE,
  KEY `par` (`idcard`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='高血压测量数据信息';

-- ----------------------------
--  Table structure for `mdmp_hx`
-- ----------------------------
DROP TABLE IF EXISTS `mdmp_hx`;
CREATE TABLE `mdmp_hx` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `idcard` varchar(50) NOT NULL COMMENT '患者证件号码',
  `hxpv` double DEFAULT NULL COMMENT '呼吸频率',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `up_time` datetime NOT NULL COMMENT '上传时间',
  `measure_time` datetime NOT NULL COMMENT '测量时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `md` (`idcard`,`measure_time`) USING BTREE,
  KEY `par` (`idcard`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='呼吸测量数据信息';

-- ----------------------------
--  Table structure for `mdmp_ori_up`
-- ----------------------------
DROP TABLE IF EXISTS `mdmp_ori_up`;
CREATE TABLE `mdmp_ori_up` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `sbbs` varchar(10) NOT NULL COMMENT '设备标示',
  `sbbh` varchar(50) NOT NULL COMMENT '设备编号',
  `up_time` datetime NOT NULL COMMENT '上传时间',
  `measure_time` datetime NOT NULL COMMENT '检测时间',
  `ori_data` varchar(2048) NOT NULL COMMENT '原始上传数据',
  `idcard` varchar(50) NOT NULL COMMENT '患者身份证号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备数据上传原始数据';

-- ----------------------------
--  Table structure for `mdmp_sao2`
-- ----------------------------
DROP TABLE IF EXISTS `mdmp_sao2`;
CREATE TABLE `mdmp_sao2` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `idcard` varchar(50) NOT NULL COMMENT '患者证件号码',
  `sao2` double DEFAULT NULL COMMENT '血氧饱和度',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `up_time` datetime NOT NULL COMMENT '上传时间',
  `measure_time` datetime NOT NULL COMMENT '测量时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `md` (`idcard`,`measure_time`) USING BTREE,
  KEY `par` (`idcard`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='血氧饱和度测量数据信息';

-- ----------------------------
--  Table structure for `mdmp_tw`
-- ----------------------------
DROP TABLE IF EXISTS `mdmp_tw`;
CREATE TABLE `mdmp_tw` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `idcard` varchar(50) NOT NULL COMMENT '患者证件号码',
  `tw` double DEFAULT NULL COMMENT '体温',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `up_time` datetime NOT NULL COMMENT '上传时间',
  `measure_time` datetime NOT NULL COMMENT '测量时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `md` (`idcard`,`measure_time`) USING BTREE,
  KEY `par` (`idcard`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='体温测量数据信息';

-- ----------------------------
--  Table structure for `mdmp_xl`
-- ----------------------------
DROP TABLE IF EXISTS `mdmp_xl`;
CREATE TABLE `mdmp_xl` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `idcard` varchar(50) NOT NULL COMMENT '患者证件号码',
  `xl` double DEFAULT NULL COMMENT '心率',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `up_time` datetime NOT NULL COMMENT '上传时间',
  `measure_time` datetime NOT NULL COMMENT '测量时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `md` (`idcard`,`measure_time`) USING BTREE,
  KEY `par` (`idcard`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='心率测量数据信息';

-- ----------------------------
--  Table structure for `mdmp_xt`
-- ----------------------------
DROP TABLE IF EXISTS `mdmp_xt`;
CREATE TABLE `mdmp_xt` (
  `id` int(11) NOT NULL COMMENT '主键',
  `idcard` varchar(50) NOT NULL COMMENT '证件编号',
  `glu` double DEFAULT NULL COMMENT '空腹血糖',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `up_time` datetime NOT NULL COMMENT '上传时间',
  `measure_time` datetime NOT NULL COMMENT '测量时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='血糖检测数据';

-- ----------------------------
--  Table structure for `mdmp_zddm_common`
-- ----------------------------
DROP TABLE IF EXISTS `mdmp_zddm_common`;
CREATE TABLE `mdmp_zddm_common` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `zdlb` varchar(10) NOT NULL COMMENT '字典类别',
  `zddm` int(11) NOT NULL COMMENT '字典标值',
  `zdms` varchar(100) NOT NULL COMMENT '字典描述',
  `xxms` varchar(100) DEFAULT NULL COMMENT '详情',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni` (`zdlb`,`zddm`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8 COMMENT='字典数据信息';

-- ----------------------------
--  Records of `mdmp_zddm_common`
-- ----------------------------
BEGIN;
INSERT INTO `mdmp_zddm_common` VALUES ('1', 'mz', '1', '东乡族', null), ('2', 'mz', '2', '乌兹别克族', ''), ('3', 'mz', '55', '京族', null), ('4', 'mz', '3', '仡佬族', null), ('5', 'mz', '4', '仫佬族', ''), ('6', 'mz', '54', '佤族', ''), ('7', 'mz', '53', '侗族', null), ('8', 'mz', '5', '俄罗斯族', null), ('9', 'mz', '6', '保安族', ''), ('10', 'mz', '7', '傈僳族', ''), ('11', 'mz', '52', '傣族', null), ('12', 'mz', '8', '哈尼族', null), ('13', 'mz', '9', '哈萨克族', null), ('14', 'mz', '51', '回族', null), ('15', 'mz', '10', '土家族', ''), ('16', 'mz', '50', '土族', ''), ('17', 'mz', '11', '基诺族', null), ('18', 'mz', '12', '塔吉克族', ''), ('19', 'mz', '13', '塔塔尔族', null), ('20', 'mz', '14', '壮族', ''), ('21', 'mz', '15', '布依族', null), ('22', 'mz', '16', '布朗族', null), ('23', 'mz', '49', '彝族', ''), ('24', 'mz', '17', '德昂族', null), ('25', 'mz', '18', '怒族', ''), ('26', 'mz', '48', '拉祜族', ''), ('27', 'mz', '19', '撒拉族', ''), ('28', 'mz', '20', '普米族', ''), ('29', 'mz', '21', '景颇族', null), ('30', 'mz', '22', '朝鲜族', null), ('31', 'mz', '23', '柯尔克孜族', null), ('32', 'mz', '24', '毛南族', ''), ('33', 'mz', '25', '水族', ''), ('34', 'mz', '26', '汉族', ''), ('35', 'mz', '27', '满族', ''), ('36', 'mz', '28', '独龙族', ''), ('37', 'mz', '29', '珞巴族', ''), ('38', 'mz', '30', '瑶族', ''), ('39', 'mz', '31', '畲族', ''), ('40', 'mz', '32', '白族', null), ('41', 'mz', '33', '纳西族', ''), ('42', 'mz', '34', '维吾尔族', ''), ('43', 'mz', '35', '羌族', ''), ('44', 'mz', '36', '苗族', ''), ('45', 'mz', '37', '蒙古族', ''), ('46', 'mz', '38', '裕固族', ''), ('47', 'mz', '39', '赫哲族', null), ('48', 'mz', '40', '达斡尔族', null), ('49', 'mz', '41', '鄂伦春族', null), ('50', 'mz', '42', '鄂温克族', null), ('51', 'mz', '43', '锡伯族', ''), ('52', 'mz', '44', '门巴族', ''), ('53', 'mz', '45', '阿昌族', null), ('54', 'mz', '46', '高山族', null), ('55', 'mz', '47', '黎族', ''), ('56', 'sex', '1', '男', null), ('57', 'sex', '2', '女', null), ('58', 'edu', '1', '大学本科', null), ('59', 'edu', '2', '大学专科', null), ('60', 'edu', '3', '硕士研究生', null), ('61', 'edu', '4', '博士研究生', null), ('62', 'edu', '5', '博士后', null), ('63', 'edu', '6', '中专/高中', null), ('64', 'edu', '7', '初中', null), ('65', 'edu', '8', '小学', null), ('66', 'edu', '99', '无', null), ('67', 'marry', '1', '未婚', null), ('68', 'marry', '2', '已婚', null), ('69', 'marry', '3', '丧偶', null), ('70', 'marry', '4', '离婚', null), ('71', 'hk', '1', '农业户口', null), ('72', 'hk', '2', '城镇户口', null);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
